feat(ssh): support BREV_SSH_CONFIG_FILE env var override#288
feat(ssh): support BREV_SSH_CONFIG_FILE env var override#288ishandhanani wants to merge 3 commits intomainfrom
Conversation
Allow users to specify a custom SSH config file path via the BREV_SSH_CONFIG_FILE environment variable. When set, brev commands (refresh, etc.) will edit the specified file instead of ~/.ssh/config. This is useful for nix-managed systems where the main SSH config is read-only.
There was a problem hiding this comment.
Pull request overview
This PR adds support for overriding the SSH config file path via the BREV_SSH_CONFIG_FILE environment variable. This is useful for systems with read-only main SSH config files (like nix-managed systems), allowing users to specify an alternative location for brev's SSH configuration changes.
Changes:
- Added environment variable check in
GetUserSSHConfigPath()to allow overriding the default~/.ssh/configpath - The override is checked first before falling back to the default behavior
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #288 +/- ##
==========================================
- Coverage 13.10% 12.63% -0.47%
==========================================
Files 112 115 +3
Lines 14480 15018 +538
==========================================
Hits 1898 1898
- Misses 12349 12886 +537
- Partials 233 234 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
BREV_SSH_CONFIG_FILEenvironment variable support to override the default~/.ssh/configpathTest plan
unset BREV_SSH_CONFIG_FILE && brev refresh-- should still edit~/.ssh/config(default behavior)export BREV_SSH_CONFIG_FILE=~/.ssh/config.local && brev refresh-- should edit~/.ssh/config.localinstead